using System;
using Newtonsoft.Json;

namespace SharePointEditor.BusinessDefinitions.Serialization
{
    public static class JSONSerializer
    {
        public static string Serialize(Object o)
        {
            var jsonSerialized = JsonConvert.SerializeObject(o);
            jsonSerialized = jsonSerialized.Replace("\"", "&quot;").Replace("'", "");
            return jsonSerialized;
        }

        public static object DeSerialize(string input, Type type)
        {
            return JsonConvert.DeserializeObject(input, type);
        }
    }
}